public class OrdenarArray {
	
	public String[] initialize (String [] array){

		array[0] = "E-5";
		array[1] = "C-3";
		array[2] = "I-9";
		array[3] = "G-7";
		array[4] = "F-6";
		array[5] = "A-1";
		array[6] = "D-4";
		array[7] = "H-8";
		array[8] = "B-2";
		array[9] = "J-0";
		
		return array;
	}
	
	public void imprimir (String [] array){
		for (int i=0 ; i<array.length ; ++i)
			System.out.println(array[i]);
	}
	
	public void bubbleSort (String [] array){
		String aux;
		for (int i=0 ; i<array.length ; ++i){
			for (int j=array.length-1; j>i ; --j){
				if (array[i].compareTo(array[j]) > 0){
					aux = array[i]; 
					array[i] = array[j];
					array[j] = aux;
				}
			}
		}
	}

	public void insertionSort (String [] array){
		int ini, pos;
		String aux;
		
		for (ini=1 ; ini<array.length ; ++ini){
			aux = array[ini];
			pos = ini - 1;
			while (pos >= 0 && array[pos].compareTo(aux) > 0){
				array[pos+1] = array[pos];
				array[pos] = aux;
				--pos;
			}
		}
	}

}
